package cn.dkk.create_design.factory.static_simple_factory;

import cn.dkk.create_design.factory.pojo.AmericanCoffee;
import cn.dkk.create_design.factory.pojo.parent.Coffee;
import cn.dkk.create_design.factory.pojo.LatteCoffee;

public class StaticSimpleCoffeeFactory {

    public static Coffee buildCoffee(String type){
        if("latte".equals(type)){
            return new LatteCoffee();
        }else if ("american".equals(type)){
            return new AmericanCoffee();
        }else {
            throw new RuntimeException("对不起没有该种咖啡");
        }
    }

}
